<template>
  <div>
    <van-icon name="arrow-left" @click="goBack" />

    <div class="mv">
      <h2>{{ mv.name }}</h2>
      <video :src="mvUrl" autoplay controls></video>
    </div>
    <!-- <div class="content">
      <div class="mv_name">
        <img :src="singerspicurl" alt="" />
        <div class="mv_name_iten">{{ singersname }}</div>
      </div>
    </div> -->
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      mvUrl: [],
      mv: {},
    };
  },
  created() {
    this.getData();
    this.getStoreMv();
  },
  methods: {
    getData() {
      axios
        .get("/api/mv/url", {
          params: {
            id: this.$route.params.id,
          },
        })
        .then((res) => {
          console.log(res.data.data);
          this.mvUrl = res.data.data[this.$route.params.id][0];
        })
        .catch((err) => {
          console.error(err);
        });
    },

    goBack() {
      this.$router.go(-1);
    },
    getStoreMv() {
      console.log(this.$store.getters.mv);
      this.mv = this.$store.getters.mv;
      this.singersname = this.mv.singers[0].name;
      this.singerspicurl = this.mv.singers[0].picurl;
    },
  },
};
</script>

<style scoped>
.mv {
  margin-top: 50px;
}
.van-icon {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 40px;
}
video {
  width: 100%;
  margin-top: 10px;
}
.content {
  widows: 100%;
  margin-top: 30px;
}
.mv_name {
  align-items: center;
  display: flex;
  font-size: 15pt;
  margin-top: 20px;
}
.mv_name img {
  width: 90px;
  height: 90px;
  border-radius: 50px;
  margin-left: 20px;
}
.mv_name_iten {
  margin-left: 20px;
}
</style>
